package com.bupt.liutong.admin.sch.dao;

import java.util.List;

import com.bupt.liutong.admin.core.base.Ibatis;
import com.bupt.liutong.admin.sch.dto.Teacher;

public class TeacherDao {

	private Ibatis ibatis;

	@SuppressWarnings("unchecked")
	public List<Teacher> getTeachersByPage(Teacher teacher) {
		return (List<Teacher>) ibatis.queryForPage("sch_teacher.getTeachers",
				teacher);
	}

	public Teacher getTeacherById(int id) {
		return (Teacher) ibatis.queryForObject("sch_teacher.getTeacherById", id);
	}

	public Integer insertTeacher(Teacher teacher) {
		return (Integer) ibatis.insert("sch_teacher.insertTeacher", teacher);
	}

	public void updateTeacher(Teacher teacher) {
		ibatis.update("sch_teacher.updateTeacher", teacher);
	}

	public void deleteTeacher(Integer id) {
		ibatis.delete("sch_teacher.deleteTeacher", id);
	}

	public void setIbatis(Ibatis ibatis) {
		this.ibatis = ibatis;
	}

	/*
	public Photo deletePhoto(Integer id) {
		
	}

	public void insertPhoto(Photo photo) {
		this.insertTeacher((Teacher) photo);
	}

	public void updatePhoto(Photo photo) {
		this.updateTeacher((Teacher) photo);
	}*/
}
